package com.cn.wanxi.thread;

public class MyRunnableMain {
    public static void main(String[] args) {
//        1.定义一个类MyRunnable，实现Runnable接口
//        2.重写Runnable里面的run方法
//        3.将具体方法写入run方法里面
//        4.创建一个执行MyRunnable的类TestRunnable
//        5.创建一个MyRunnable对象
//        6.创建一个Thread对象，并将MyRunnable对象当中参数传入
//        7.开启线程
        MyRunable myRunable=new MyRunable();
        Thread thread=new Thread(myRunable,"线程1");
        thread.start();
        Thread thread1=new Thread(myRunable,"线程2");
        thread1.start();
        Thread thread2=new Thread(myRunable,"线程3");
        thread2.start();
    }
}
